package com.waitingresult.web.controller;

import com.alibaba.fastjson2.JSON;
import com.waitingresult.web.entity.BaseEntity;
import com.waitingresult.web.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: WangShuai
 * @CreateTime: 2023-01-05  17:49
 * @Description:
 * @Version: 1.0
 */
@RequestMapping("1")
@RestController
public class DemoController {
    @RequestMapping("demo")
    public void demo(){

    }

    public static void main(String[] args) {
        String jsonString = "{\n" +
                "\t\"name\": \"luyuan\",\n" +
                "\t\"address\": \"yuhang\"\n" +
                "}";
        BaseEntity baseEntity = JSON.parseObject(jsonString, User.class);
        User user = (User) baseEntity;
        System.out.println("ok");
    }
}
